package com.hyzx.qbasic.admin.domain.service.impl;

import com.github.pagehelper.PageInfo;
import com.hyzx.qbasic.admin.model.po.BusinessLogPO;
import com.hyzx.qbasic.admin.model.po.ErrorLogPO;
import com.hyzx.qbasic.admin.model.po.UserLoginLogPO;
import com.hyzx.qbasic.admin.model.vo.req.admin.GetBusinessLogListReq;
import com.hyzx.qbasic.admin.model.vo.req.admin.GetErrorLogListReq;
import com.hyzx.qbasic.admin.domain.repository.ILogRepository;
import com.hyzx.qbasic.admin.domain.service.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by 黄江华 on 2017/11/1
 */

@Service("logService")
public class LogServiceImpl implements ILogService {
    @Autowired
    private ILogRepository logRepository;

    @Override
    public boolean addUserLoginLog(UserLoginLogPO logInfo) {
        return logRepository.addUserLoginLog(logInfo);
    }

    @Override
    public boolean addBusinessLog(BusinessLogPO logInfo) {
        return logRepository.addBusinessLog(logInfo);
    }

    @Override
    public PageInfo<BusinessLogPO> getBusinessLogList(GetBusinessLogListReq req) {
        PageInfo<BusinessLogPO> logList = logRepository.getBusinessLogList(req);

        return logList;
    }

    @Override
    public boolean addErrorLog(ErrorLogPO logInfo) {
        return logRepository.addErrorLog(logInfo);
    }

    @Override
    public PageInfo<ErrorLogPO> getErrorLogList(GetErrorLogListReq req) {
        PageInfo<ErrorLogPO> logList = logRepository.getErrorLogList(req);

        return logList;
    }

    @Override
    public ErrorLogPO getErrorLogDetail(int logId) {
        return logRepository.getErrorLogDetail(logId);
    }
}
